Better default for which-key-echo-keystrokes
authorjustbur <justin@burkett.cc>
Tue, 26 Apr 2016 15:08:32 +0000 (11:08 -0400)
committerjustbur <justin@burkett.cc>
Tue, 26 Apr 2016 15:08:32 +0000 (11:08 -0400)
Fixes #114

which-key.el

index ae58344153c6c2d8c70d57f291c696ff0f6a4847..9ad5f522c96f0deaf282dcacdc955df473743fbc 100644 (file)
@@ -67,7 +67,11 @@ this behavior."
   :group 'which-key
   :type 'float)
 
-(defcustom which-key-echo-keystrokes 0
+(defcustom which-key-echo-keystrokes (if (and echo-keystrokes
+                                              (> echo-keystrokes
+                                                 which-key-idle-delay))
+                                         (/ (float which-key-idle-delay) 4)
+                                       echo-keystrokes)
   "Value to use for `echo-keystrokes'.
 This only applies if `which-key-popup-type' is minibuffer or
 `which-key-show-prefix' is echo. It needs to be less than
@@ -556,7 +560,7 @@ alongside the actual current key sequence when
 
 (defun which-key--setup ()
   "Initial setup for which-key.
-Reduce `echo-keystrokes' if necessary (it will interfer if it's
+Reduce `echo-keystrokes' if necessary (it will interfere if it's
 set too high) and setup which-key buffer."
   (when (or (eq which-key-show-prefix 'echo)
             (eq which-key-popup-type 'minibuffer))
@@ -567,7 +571,7 @@ set too high) and setup which-key buffer."
   (setq which-key--is-setup t))
 
 (defun which-key--setup-echo-keystrokes ()
-  "Reduce `echo-keystrokes' if necessary (it will interfer if
+  "Reduce `echo-keystrokes' if necessary (it will interfere if
 it's set too high)."
   (let (;(previous echo-keystrokes)
         )